package christ.mmd.bl;

import java.util.ArrayList;
import java.util.Date;

import android.os.Parcel;
import android.os.Parcelable;

public class Holiday extends DataItem implements Parcelable {
	Date mDate;
	String mTitle;
	String mArticleUrl;
	String mDescription;
	ArrayList<Image> mImages;

	public Holiday(long id, Date date, String title, String articleUrl,
			String description) {
		this(id, date, title, articleUrl, description, new ArrayList<Image>());
	}

	public Holiday(long id, Date date, String title, String articleUrl,
			String description, ArrayList<Image> images) {
		super(id);
		mDate = date;
		mTitle = title;
		mArticleUrl = articleUrl;
		mDescription = description;
		mImages = images;
	}

	public Holiday(Parcel in) {
		this(in.readLong(), new Date(in.readLong()), in.readString(), in
				.readString(), in.readString());
		in.readList(mImages, getClass().getClassLoader());
	}

	public Date getDate() {
		// TODO Auto-generated method stub
		return mDate;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(mId);
		dest.writeLong(mDate.getTime());
		dest.writeString(mTitle);
		dest.writeString(mArticleUrl);
		dest.writeString(mDescription);
		dest.writeList(mImages);
	}

	public static final Parcelable.Creator<Holiday> CREATOR = new Parcelable.Creator<Holiday>() {
		public Holiday createFromParcel(Parcel in) {
			return new Holiday(in);
		}

		public Holiday[] newArray(int size) {
			return new Holiday[size];
		}
	};
}
